package org.iks.store.business.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.iks.common.pojo.user.UserInfoVo;
import org.iks.store.business.entity.SessionEntity;
import org.iks.store.business.vo.secret.SecretCreateItemVo;
import org.iks.store.business.vo.session.SessionMessageVo;
import org.iks.store.business.vo.session.SessionVo;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Author kzou
 * Date 2024/2/13
 * Description:
 */
public interface SessionService extends IService<SessionEntity> {

    @Transactional(rollbackFor = Exception.class)
    int createSession(String creatorAccount, List<SecretCreateItemVo> members);

    void addMember(Integer sessionId, String account);

    List<UserInfoVo> queryMembers(Integer sessionId);

    void deleteMember(Integer sessionId, String userAccount);

    List<SessionMessageVo> querySessionMessageList(String userAccount);

    SessionVo querySession(Integer sessionId);

    int queryUnReadMessageCount(Integer sessionId, String userAccount);

    Integer queryUserDefaultSession(String userAccount);

    /**
     * 创建默认会话
     */
    Integer createUserDefaultSession(String userAccount);

}
